<ui:composition template="../index/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">
		<p:fieldset legend="Lista de Guias">
				<h:form>
					<p:dataTable value="#{guiaBean.guias}"
						var="guia" paginator="true" rows="8">
						
						<p:column filterBy="#{guia.planoSaude}" filterMatchMode="contains" headerText="Plano de Saude">
							<h:outputText value="#{guia.planoSaude}"></h:outputText>
						</p:column>
						<p:column headerText="Pagador">
							<h:outputText value="#{guia.pagador.nome}"></h:outputText>
						</p:column>
						<p:column headerText="Data">
							<h:outputText value="#{guia.dataInicial}"></h:outputText>
						</p:column>
						<p:column>
							<h:commandLink style="padding:3px" action="#{guiaBean.view}" value="Vizualizar">
								<f:setPropertyActionListener target="#{guiaBean.guia}" value="#{guia}" />
							</h:commandLink>
						</p:column>

					</p:dataTable>
					
					<h:commandLink style="padding:3px" action="#{guiaBean.gerar}" value="Gerar Guias"/>
				
				</h:form>
		</p:fieldset>
	</ui:define>
</ui:composition>